# -*- coding: utf-8 -*-
import bugsnag
from bugsnag.tornado import BugsnagRequestHandler
import logging
from tornado.web import RequestHandler, Application
from tornado import ioloop

# try:
#     raise Exception('Something went wrong!')
# except Exception as exception:
#     bugsnag.notify(exception)
#     raise exception

# logger = logging.getLogger("test.logger")
# handler = BugsnagRequestHandler()
# handler.setLevel(logging.ERROR)
# logger.addHandler(handler)

class MainHandler(BugsnagRequestHandler):
    def get(self):
        self.write(f"Hello, world!")

def make_app():
    return Application([
        (r"/", MainHandler)
    ])

if __name__ == "__main__":
    app = make_app()
    app.listen(8080)
    ioloop.IOLoop.current().start()